//
//  ImportantRiskView.m
//  SmartWatch
//
//  Created by zwj on 2022/11/26.
//

#import "ImportantRiskView.h"

@implementation ImportantRiskView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = BACKGROUNDCOLOR;
        self.layer.cornerRadius = 10;
        
        MyLinearLayout *root = [MyLinearLayout linearLayoutWithOrientation:MyOrientation_Vert];
        root.myHorzMargin = 0;
        root.padding = UIEdgeInsetsMake(20, 15, 0, 15);
        root.myHeight = frame.size.height;
        [self addSubview:root];
        
        
        UILabel *name = [UILabel createLabelText:@"经连续14笔的健康检测值分析预测：" font:UIFontMake(15) textColor:COLOR666];
        name.myHeight = 20;
        name.myHorzMargin = 0;
        [root addSubview:name];
        
        UIView *dian = UIView.new;
        dian.useFrame = YES;
        [dian az_setGradientBackgroundWithColors:@[HexColor(@"#C4EFEC"),COLOR_4   ] locations:@[@0.0,@1.0] startPoint:CGPointMake(0, 0) endPoint:CGPointMake(1, 1)];
        ViewCorner(dian, 9);
        [root addSubview:dian];
        [dian mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(name).offset(-7);
            make.bottom.mas_equalTo(name.mas_bottom).offset(30);
            make.size.mas_equalTo(CGSizeMake(18, 18));
        }];
        
        UILabel *detail = [UILabel createLabelText:@"一年内您无重大疾病风险" font:UIFontBoldMake(17) textColor:COLOR1515];
        detail.myHeight = kAutoHeight;
        detail.myTop = 15;
        detail.myHorzMargin = 0;
        [root addSubview:detail];
        
        
        UILabel *title = [UILabel createLabelText:@"本项功能预测之十大疾病是：" font:UIFontMake(14) textColor:HexColor(@"#454545")];
        title.myHeight = kAutoHeight;
        title.myTop = 20;
        title.myHorzMargin = 0;
        [root addSubview:title];
        
        UIScrollView *scrollView = [[UIScrollView alloc]init];
        scrollView.myHorzMargin = 0;
        scrollView.weight = 1;
        scrollView.myTop = 10;
        [root addSubview:scrollView];
        
        {
            MyLinearLayout *content = [MyLinearLayout linearLayoutWithOrientation:MyOrientation_Vert];
            content.myHorzMargin = 0;
            content.myHeight = kAutoHeight;
            content.subviewVSpace = 5;
            [scrollView addSubview:content];
            
            for (int i = 0; i < 12; i++) {
                UILabel *item = [UILabel createLabelText:@"1.心血管内皮细胞缺氧" font:UIFontMake(14) textColor:HexColor(@"#454545")];
                item.myHeight = kAutoHeight;
                item.myHorzMargin = 0;
                [content addSubview:item];
            }
            
        }
        
        UIView *line = [UIView new];
        line.myTop = 15;
        line.myHorzMargin = 0;
        line.myHeight = 1.0;
        line.backgroundColor = HexColor(@"#E3E3E3");
        [root addSubview:line];
        
        UIButton *submitBtn = [UIButton createButtonText:@"确认" font:UIFontMake(14) textColor:THEME_COLOR];
        submitBtn.myHorzMargin = 0;
        submitBtn.myHeight = 45;
        [root addSubview:submitBtn];
    }
    return self;
}

@end
